<?php

use think\migration\Migrator;
use think\migration\db\Column;

class Meun extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
     *
     * The following commands can be used in this method and Phinx will
     * automatically reverse them when rolling back:
     *
     *    createTable
     *    renameTable
     *    addColumn
     *    renameColumn
     *    addIndex
     *    addForeignKey
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change()
    {
        $this->execute("
            DROP TABLE IF EXISTS `sys_meun`;
            CREATE TABLE IF NOT EXISTS `sys_meun` (
              `id` int(11) not null primary key auto_increment comment '主键',
              `meun_name` nvarchar(256) not null default '' comment '菜单名称',
              `mudel_name` nvarchar(256) not null default '' comment '模块名称',
              `controller_name` nvarchar(256) not null default '' comment '控制器名称',
              `create_time` datetime not null default now() comment '创建时间',
              `update_time` datetime not null default now() comment '更新时间'
            ) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8 COMMENT='菜单表'
        ");
    }
}
